﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;
namespace Models
{
    /// <summary>
    /// 数据库实例封装
    /// 字段属性跟数据字段名相同
    /// </summary>
    public class T_CS_COMMUNITY_Models
    {
        private int sEQID_INT;

        public int SEQID_INT
        {
            get { return sEQID_INT; }
            set { sEQID_INT = value; }
        }
        private string cOMMUNITYCODE_CHR;

        public string COMMUNITYCODE_CHR
        {
            get { return cOMMUNITYCODE_CHR; }
            set { cOMMUNITYCODE_CHR = value; }
        }
        private string cOMMUNITYNAME_VCHR;

        public string COMMUNITYNAME_VCHR
        {
            get { return cOMMUNITYNAME_VCHR; }
            set { cOMMUNITYNAME_VCHR = value; }
        }
        private string pARENTCOMMUNITY_CHR;

        public string PARENTCOMMUNITY_CHR
        {
            get { return pARENTCOMMUNITY_CHR; }
            set { pARENTCOMMUNITY_CHR = value; }
        }
        private string pOSTALCODE_CHR;

        public string POSTALCODE_CHR
        {
            get { return pOSTALCODE_CHR; }
            set { pOSTALCODE_CHR = value; }
        }
        private string cOMMUNITYLEVEL_INT;

        public string COMMUNITYLEVEL_INT
        {
            get { return cOMMUNITYLEVEL_INT; }
            set { cOMMUNITYLEVEL_INT = value; }
        }
        private string rEGIONALISMCODE_VCHR;

        public string REGIONALISMCODE_VCHR
        {
            get { return rEGIONALISMCODE_VCHR; }
            set { rEGIONALISMCODE_VCHR = value; }
        }
        private int cURRENTCS_INT;

        public int CURRENTCS_INT
        {
            get { return cURRENTCS_INT; }
            set { cURRENTCS_INT = value; }
        }

        public void LoadModels(SqlDataReader dr)
        {
            sEQID_INT = dr.GetInt32(0);
            cOMMUNITYCODE_CHR = dr.GetString(1);
            cOMMUNITYNAME_VCHR = dr.GetString(2);
            pARENTCOMMUNITY_CHR = dr.GetString(3);
            pOSTALCODE_CHR = dr.GetString(4);
            cOMMUNITYLEVEL_INT = dr.GetString(5);
            rEGIONALISMCODE_VCHR = dr.GetString(6);
            //cURRENTCS_INT = dr.GetInt32(7);
            cURRENTCS_INT = Convert.ToInt32(dr.GetDecimal(7));
        }
    }
}
